// 电网卡片组件模拟数据 - 旧版本备份
// 此文件已被 mock.ts 替代，保留作为备份参考

// 时间轴数据（24小时）
const timePoints = [
  "02:00",
  "04:00",
  "06:00",
  "08:00",
  "10:00",
  "12:00",
  "14:00",
  "16:00",
  "18:00",
  "20:00",
  "22:00",
  "24:00"
];

// 向电网输出数据（Export to Grid）
export const exportData = {
  totalPower: "12.5 kWh",
  chartData: {
    xAxis: timePoints,
    // 白天太阳能充足时向电网输出较多
    yAxis: [0.2, 0.1, 0.5, 1.2, 2.8, 3.5, 3.8, 3.2, 2.1, 1.0, 0.5, 0.3]
  },
  // 输出去向分布
  distributionData: [
    {
      name: "To Grid Sale",
      value: 8.5,
      percentage: "68%",
      color: "#1E88E5" // 蓝色（电网销售）
    },
    {
      name: "To Neighbors",
      value: 2.8,
      percentage: "22%",
      color: "#20c997" // 绿色（邻居共享）
    },
    {
      name: "To Storage",
      value: 1.2,
      percentage: "10%",
      color: "#fcc419" // 黄色（储能）
    }
  ]
};

// 从电网进口数据（Import from Grid）
export const importData = {
  totalPower: "18.7 kWh",
  chartData: {
    xAxis: timePoints,
    // 夜晚和用电高峰时从电网进口较多
    yAxis: [2.5, 2.8, 1.5, 1.0, 0.5, 0.3, 0.2, 0.8, 1.5, 2.8, 3.5, 3.8]
  },
  // 进口用途分布
  distributionData: [
    {
      name: "For Home Use",
      value: 12.4,
      percentage: "66%",
      color: "#10b981" // 绿色（家庭使用）
    },
    {
      name: "For Charging",
      value: 4.2,
      percentage: "22%",
      color: "#4dabf7" // 蓝色（充电）
    },
    {
      name: "For Equipment",
      value: 2.1,
      percentage: "12%",
      color: "#f59e0b" // 橙色（设备）
    }
  ]
};

// 导出数据类型定义
export interface GridDataType {
  totalPower: string;
  chartData: {
    xAxis: string[];
    yAxis: number[];
  };
  distributionData: Array<{
    name: string;
    value: number;
    percentage: string;
    color: string;
  }>;
}

// 获取数据的工具函数
export function getGridData(mode: "export" | "import"): GridDataType {
  return mode === "export" ? exportData : importData;
}
